//
//  HomeSearchCell.m
//  NewPro
//
//  Created by 何荧红 on 2019/4/10.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "HomeSearchCell.h"

@interface HomeSearchCell ()
@property (nonatomic, strong) UILabel *title;

@end

@implementation HomeSearchCell

- (void)setSubtitle:(NSString *)Subtitle{
    _Subtitle = Subtitle;
    if (_Subtitle) {
        if (_Subtitle.length > 0) {
            self.title.text = _Subtitle;
        }
    }
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self CreateCell];
    }
    return self;
}
- (void)CreateCell{
    UIImageView *icon = [[UIImageView alloc]init];
    icon.image = [UIImage imageNamed:@"灰色记录"];
    [self addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
        make.left.equalTo(self.mas_left).offset(15);
        make.centerY.equalTo(self.mas_centerY);
    }];
    self.title = [[UILabel alloc]init];
    _title.textColor = [UIColor colorWithHexString:@"666666"];
    _title.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:13];
    [self addSubview:_title];
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(43);
    }];
    UIView *line = [[UIView alloc]init];
    line.backgroundColor = [UIColor colorWithHexString:@"E6E6E6"];
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.bottom.equalTo(self.mas_bottom);
        make.width.mas_equalTo(SCREEN_WIDTH - 30);
        make.height.mas_equalTo(1);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
